package 强化训练;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class day31因子分解 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int n = sc.nextInt();
            List<String> res = function(n);
            //将res集合传入到String.valueOf(" * " ,res) 中，结果就是为res1 * res2 * res3 ...
            System.out.printf("%d = %s\n",n,String.join(" * ",res));
        }
    }

    private static List<String> function(int n){
        List<String> res = new ArrayList<>();
        for (int i = 2; n > 1 && i * i <= n; i++) {
            while (n % i == 0){
                res.add(String.valueOf(i));
                n /= i;
            }
        }
        if (n != 1){
            res.add(String.valueOf(n));
        }
        return res;
    }
}
